package br.com.bestOffer.util;

import java.io.Serializable;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.Flash;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class WebResources implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -1260555456122695222L;

	public static Flash getFlashContext(){
	       return FacesContext.getCurrentInstance().getExternalContext().getFlash();
	   }
	   
	   public static HttpSession getSession(){
	       return ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getSession();
	   }
	   
	   public static HttpServletRequest getRequest(){
	       return ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest());
	   }
	   
	   public static ExternalContext getContext(){
	       return FacesContext.getCurrentInstance().getExternalContext();
	   }
	   
	   
}
